Pharmacogenomic algorithm